<?php


namespace App\Controller;

use App\Request\FooRequest;
use Hyperf\HttpServer\Annotation\AutoController;
use App\Exception\FooException;
use Hyperf\Di\Annotation\Inject;
/**
 * @AutoController()
 * Class ExceptionController
 * @package App\Controller
 */
class ExceptionController extends AbstractController
{

    /**
     * @inject()
     * @var FooRequest
     */
    private $fooRequest;

    public function exception()
    {

        $exp = $this->request->input('exp','1');
        if ($exp == 1) {
            Throw new FooException("23",'500');
        }

    }

    public function validated()
    {

        $data = $this->fooRequest->validated();
        return $data;


    }


}